home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 23 / AMIGAplus Sonderheft 23 (2000)(Falke)(DE)[!].iso / PublicDomain / Goldies / PolyEd2 / Macros / jb_chelp.ped < prev    next >
Text File  |  1999-11-08  |  2KB  |  65 lines

  1. /*
  2. ** $VER: jb_chelp.rexx 1.0 (19.3.95) written by Johan Billing
  3. **
  4. ** Looks up the word under the cursor using CHelp. CHelp is not loaded
  5. ** all the time. If you want to have CHelp resident and use the ARexx
  6. ** interface, you have to modify this macro.
  7. */
  8.  
  9. OPTIONS RESULTS
  10.  
  11. OPTIONS FAILAT 11                           /* ignore warnings          */
  12. SIGNAL ON SYNTAX                            /* ensure clean exit        */
  13. SIGNAL ON FAILURE
  14. SIGNAL ON BREAK_C                            /* no label->syntax->exit    */
  15.  
  16. if (LEFT(ADDRESS(), 6) ~= "POLYED") then do
  17.     if SHOW("Ports", "POLYED.1") then
  18.         address 'POLYED.1'
  19.     else do
  20.         say "PolyEd is not running!"
  21.         exit
  22.     end
  23. end
  24.  
  25. 'LOCKGUI'
  26.  
  27. /*----- begin of custom code area --------------------------------------*/
  28.  
  29. /* You will probably want to change this: */
  30.  
  31. chelp='dcc:chelp/chelp'
  32.  
  33. IF ~SHOW(Libraries,'rexxsupport.library') THEN
  34.     IF ~ADDLIB("rexxsupport.library",0,-30,0) THEN EXIT
  35.  
  36. oldport=address()
  37.  
  38. 'getword'
  39. word=result
  40.  
  41. if word="" then exit
  42.  
  43. address command chelp '>T:CHelp.tmp' word
  44. address value oldport
  45.  
  46. 'UNLOCKGUI' /* affects the active window and must be done here */
  47.  
  48. 'OPEN FILENAME "T:CHelp.tmp"'
  49. call delete('T:CHelp.tmp')
  50.  
  51. /*----- end of custom code area ----------------------------------------*/
  52.  
  53. 'UNLOCKGUI'
  54. EXIT
  55.  
  56. SYNTAX:                                     /* ARexx error...           */
  57.  
  58. say "Error line" SIGL ":" ERRORTEXT(RC)     /* report it...             */
  59. 'UNLOCKGUI'                                 /* Unlock GUI!              */
  60. EXIT                                        /* exit                     */
  61.  
  62. FAILURE:
  63. 'UNLOCKGUI'                                 /* Unlock GUI!              */
  64. EXIT                                        /* exit                     */
  65.